package tools;

import lombok.Getter;
import lombok.Setter;


public enum ConstellationEnum {

    BAIYANG(1, "白羊座"),
    JINNIU(2, "金牛座"),
    SHUANGZI(3, "双子座"),
    JUXIE(4, "巨蟹座"),
    SHIZI(5, "狮子座"),
    CHUNV(6, "处女座"),
    TIANCHENG(7, "天秤座"),
    TIANXIE(8, "天蝎座"),
    SHESHOU(9, "射手座"),
    MOXIE(10, "摩羯座"),
    SHUIPING(11, ""),
    SHUANGYU(12, "双鱼座"),
    UNKNOWN(0, "保密");

    @Getter
    @Setter
    private int type;
    @Getter
    @Setter
    private String des;

    ConstellationEnum(int type, String des) {
        this.type = type;
        this.des = des;
    }

    public static ConstellationEnum getByType(int type) {
        for(ConstellationEnum ve : values()) {
            if (CompareUtils.areEquals(ve.getType(), type)) {
                return ve;
            }
        }
        return UNKNOWN;
    }
}
